<?php
/**
 * @version     1.0.0
 * @package     com_travel
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      thinh <dinhducthinh88@yahoo.com> - http://
 */

// No direct access.
defined('_JEXEC') or die;

jimport('joomla.application.component.modeladmin');
/**
 * Tour model.
 */
class TravelModelTour extends JModelAdmin
{

	public function getTable($name='Tour',$prefix='TravelTable',$config = array()){
		return parent::getTable($name,$prefix,$config);
	}
	
	public function getForm($data = array(), $loadData = true)
	{
		// Initialise variables.
		global $app;
		$form = $this->loadForm('com_travel.field','tour',array('control' => 'jform', 'load_data' => $loadData));
		if(empty($form)){
			return false;
		}
		return $form;
	}
	
	protected function loadFormData(){
		global $app;
		// Check the session for previously entered form data.
		$data = $app->getUserState('com_travel.edit.tour.data',array());
		
		if (empty($data)) {
			$data = $this->getItem();
		}
		return $data;
	}
}